03. 概率练习
概率练习
在这个练习中,你将模拟掷硬币和掷骰子,计算下列结果的比例。
- 两次均衡掷硬币得到两次正面
- 三次均衡掷硬币得到一次正面
- P(H) = 0.6 时三次非均衡掷硬币得到一次正面
- 一次掷骰子得到偶数
- 两次掷骰子得到相同值
然后,你在下面的练习中对比这些比例的概率。
模拟掷硬币时,0 代表正面,1 代表反面。模拟掷骰子时,使用正确的整数,匹配标准六面骰子上的数字。
Workspace
This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.
Workspace Information:
- Default file path:
- Workspace type: jupyter
- Opened files (when workspace is loaded): n/a
QUIZ QUESTION: :
请使用在模拟数据中观察到的比例,去猜测下列结果的概率。
ANSWER CHOICES:
结果 |
概率 |
---|---|
0 |
|
0.75 |
|
0.083 |
|
0.375 |
|
0.333 |
|
0.6 |
|
0.25 |
|
0.5 |
|
0.288 |
|
0.167 |
|
1 |
SOLUTION:
结果 |
概率 |
---|---|
0.375 |
|
0.25 |
|
0.5 |
|
0.288 |
|
0.167 |